package com.human.controller;

import com.human.entity.Emp;
import com.human.entity.ResultVo;
import com.human.service.LoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jzq
 * @date 2023/3/11 16:43
 */
@SuppressWarnings({"all"})
@RestController
@RequestMapping("/api")
@Api(tags = "登录退出")
public class LoginController {

    @Autowired
    LoginService loginService;

    @PostMapping("/login")
    @ApiOperation(value = "登录")
    public ResultVo login(@RequestBody Emp emp) {
        return loginService.login(emp);
    }

    @PostMapping("/logout")
    @ApiOperation(value = "退出")
    public ResultVo logout() {
        return loginService.logout();
    }

}
